package com.foreknow.controller;

import com.foreknow.entity.ConstantItem;
import com.foreknow.entity.Department;
import com.foreknow.service.DepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "DepartmentController",description = "科室管理")
@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation("获取科室分类名称")
    @GetMapping("/getDeptCategory")
    public List<Department> getDeptCategory(){
        return departmentService.getDeptCategory();
    }

    @ApiOperation("获取科室名称")
    @PostMapping("/deptListByType")
    public List<Department> deptListByType(Integer deptCategoryId){
        return departmentService.deptListByType(deptCategoryId);
    }

}
